﻿
<template>
    <section>




        <!--工具条-->
        <el-col :span='24' class='toolbar' style='padding-bottom: 0px;'>
            <el-form :inline='true' :model='filters' @submit.native.prevent>
                <el-form-item>
                    <el-input v-model='filters.name' placeholder='名称/Key'></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type='primary' @click='getDtoPage'>查询</el-button>
                </el-form-item>
                <el-form-item>
                    <el-button type='primary' @click='handleAdd'>新增</el-button>
                </el-form-item>
                <el-button type='danger' @click='batchRemove' :disabled='this.sels.length===0'>批量删除</el-button>

                <!--<el-button v-if="isAuth('DTSN:TongDao:Add')" type="primary">权限</el-button>-->

            </el-form>
        </el-col>

        <!--列表-->
        <el-table :data='users' highlight-current-row v-loading='listLoading' @selection-change='selsChange'
                  style='width: 100%;'
                  sortable='custom'
                  @sort-change='sortChange'>


            <el-table-column type="selection" width="50"> </el-table-column>
            <el-table-column type="index" width="80"></el-table-column>

            <el-table-column prop='TD_Name' label='通道名称' width='100' sortable>  </el-table-column>
            <el-table-column prop='TD_Code' label='通道代码' width='100' sortable>  </el-table-column>
            <el-table-column prop='TD_WuLiaoCode' label='物料代码' width='100' sortable>  </el-table-column>

            <el-table-column prop='SWJ_Name' label='上位机' width='120' sortable>  </el-table-column>
            <!--<el-table-column prop='TD_ReadCardIP' label='OPC' width='' sortable>  </el-table-column>-->

            <el-table-column prop='TD_Type' label='配型' width='80' sortable>
                <template slot-scope="scope">
                    <span v-if="scope.row.TD_Type == '1'" style="color:rgb( 195, 29, 84);">熟料</span>
                    <span v-else-if="scope.row.TD_Type == '2'" style="color:rgb(84, 195, 29);">散料</span>
                    <span v-else style="color:rgb(255, 106, 0);">未设置</span>
                </template>
            </el-table-column>


            <el-table-column prop="TD_State" label="状态" width="80" sortable>
                <template slot-scope="scope">
                    <el-tag :type="scope.row.TD_State|getBindStatus"
                            close-transition>{{scope.row.TD_State|getBindText}}</el-tag>
                </template>
            </el-table-column>

            <!--<el-table-column prop='TD_CreateTime' label='创建时间' width='100' sortable>  </el-table-column>-->
            <!--
                <el-table-column prop='TD_Remark' label='备注' width='' sortable>  </el-table-column>
                <el-table-column prop='TD_ID' label='通道' width='' sortable>  </el-table-column>
                <el-table-column prop='TD_WuLiao' label='物料名称' width='' sortable>  </el-table-column>
                <el-table-column prop='TD_WuLiaoCode' label='物料代码' width='' sortable>  </el-table-column>
                <el-table-column prop='TD_Weight' label='重量' width='' sortable>  </el-table-column>
                <el-table-column prop='TD_WeightA' label='重量' width='' sortable>  </el-table-column>
            -->

            <el-table-column label='操作' width=''>
                <template scope='scope'>
                    <el-button size='small' @click='WlTypeEdit(scope.$index, scope.row)'> 更新物料 </el-button>

                    <el-button size='small' @click='handleEdit(scope.$index, scope.row)'> 编辑 </el-button>
                    <el-button type='danger' size='small' @click='handleDel(scope.$index, scope.row)'>删除</el-button>
                </template>
            </el-table-column>

        </el-table>

        <!-- 工具条 ,分页 -->
        <el-col :span='24' class='toolbar'>

            <el-pagination @size-change="handleSizeChange"
                           @current-change="handleCurrentChange"
                           :current-page="pageIndex"
                           :page-sizes="[ 20, 50, 100]"
                           :page-size="pageSize"
                           layout="total, sizes, prev, pager, next, jumper"
                           :total="total"
                           style='float:right;'>
            </el-pagination>
        </el-col>

        <!--编辑界面-->
        <el-dialog title='编辑' :visible.sync='editFormVisible' v-model='editFormVisible' :close-on-click-modal='false'>
            <el-form :model='editForm' label-width='80px' :rules='editFormRules' ref='editForm'>
                <!--<el-form-item label='通道' prop='TD_ID'>
                    <el-input v-model='editForm.TD_ID' auto-complete='off'></el-input>
                </el-form-item>-->

                <el-form-item label='通道名称' prop='TD_Name'>
                    <el-input v-model='editForm.TD_Name' auto-complete='off'></el-input>
                </el-form-item>

                <el-form-item label='通道代码' prop='TD_Code'>
                    <el-input v-model='editForm.TD_Code' auto-complete='off'></el-input>
                </el-form-item>

                <el-form-item label="类型" prop="TD_Type">
                    <template>
                        <el-radio-group v-model="editForm.TD_Type">
                            <el-radio v-for="item in typeList"
                                      :key="item.value"
                                      :value="item.value"
                                      :label="item.value">{{ item.text }}</el-radio>

                        </el-radio-group>
                    </template>
                </el-form-item>


                <el-form-item label='上位机' prop='TD_ShangWeiji'>
                    <el-select style="width: 100%;" v-model="editForm.TD_ShangWeiji" placeholder="请选择上位机">
                        <el-option v-for="item in list_ShangWeiji" :key="item.ID" :value="item.ID" :label="item.SWJ_Name">
                            <span style="float: left">{{ item.SWJ_Name }}</span>
                        </el-option>
                    </el-select>
                </el-form-item>
                <!--<el-form-item label='状态' prop='TD_State'>
                    <el-input v-model='editForm.TD_State' auto-complete='off'></el-input>
                </el-form-item>-->
                <!--<el-form-item label='物料名称' prop='TD_WuLiao'>
                    <el-input v-model='editForm.TD_WuLiao' auto-complete='off'></el-input>
                </el-form-item>-->
                <!--<el-form-item label='物料代码' prop='TD_WuLiaoCode'>
                    <el-input v-model='editForm.TD_WuLiaoCode' auto-complete='off'></el-input>
                </el-form-item>


                <el-form-item label='读卡器IP' prop='TD_ReadCardIP'>
                    <el-input v-model='editForm.TD_ReadCardIP' auto-complete='off'></el-input>
                </el-form-item>-->



                <el-form-item label='状态' prop='TD_State'>
                    <template>
                        <el-radio-group v-model="editForm.TD_State">
                            <el-radio v-for="item in listState"
                                      :key="item.value"
                                      :label="item.value">{{item.text}}</el-radio>
                        </el-radio-group>
                    </template>
                </el-form-item>


                <el-form-item label='备注' prop='TD_Remark'>
                    <el-input v-model='editForm.TD_Remark' auto-complete='off'
                              type="textarea" :rows="3"></el-input>
                </el-form-item>



            </el-form>
            <div slot='footer' class='dialog-footer'>
                <el-button @click.native='editFormVisible = false'>取消</el-button>
                <el-button type='primary' @click.native='editSubmit' :loading='editLoading'>提交</el-button>
            </div>
        </el-dialog>

        <!--新增界面-->
        <el-dialog title='新增' :visible.sync='addFormVisible' v-model='addFormVisible' :close-on-click-modal='false'>
            <el-form :model='addForm' label-width='80px' :rules='addFormRules' ref='addForm'>



                <!--<el-form-item label='通道' prop='TD_ID'>
                    <el-input v-model='addForm.TD_ID' auto-complete='off'></el-input>
                </el-form-item>-->


                <el-form-item label='通道名称' prop='TD_Name'>
                    <el-input v-model='addForm.TD_Name' auto-complete='off' placeholder="请填写通道名称"></el-input>
                </el-form-item>

                <el-form-item label='通道代码' prop='TD_Code'>
                    <el-input v-model='addForm.TD_Code' auto-complete='off'></el-input>
                </el-form-item>

                <el-form-item label="类型" prop="TD_Type">
                    <template>
                        <!--:value="item.value"-->
                        <el-radio-group v-model="addForm.TD_Type">
                            <el-radio v-for="item in typeList"
                                      :key="item.value" :value="item.value"
                                      :label="item.value">{{ item.text }}</el-radio>
                        </el-radio-group>
                    </template>
                </el-form-item>



                <!--<el-form-item label='物料名称' prop='TD_WuLiao'>
                    <el-input v-model='addForm.TD_WuLiao' auto-complete='off'></el-input>
                </el-form-item>-->
                <!--<el-form-item label='物料代码' prop='TD_WuLiaoCode'>
                    <el-input v-model='addForm.TD_WuLiaoCode' auto-complete='off'></el-input>
                </el-form-item>-->
                <!--//========================================-->
                <el-form-item label='上位机' prop='TD_ShangWeiji'>
                    <el-select style="width: 100%;" v-model="addForm.TD_ShangWeiji" placeholder="请选择上位机">
                        <el-option v-for="item in list_ShangWeiji" :key="item.ID" :value="item.ID" :label="item.SWJ_Name">
                            <span style="float: left">{{ item.SWJ_Name }}</span>
                        </el-option>
                    </el-select>
                </el-form-item>
                <!--<el-form-item label='读卡器IP' prop='TD_ReadCardIP'>
                    <el-input v-model='addForm.TD_ReadCardIP' auto-complete='off'></el-input>
                </el-form-item>-->
                <!--===============================================-->

                <el-form-item label='状态' prop='TD_State'>
                    <template>
                        <el-radio-group v-model="addForm.TD_State">
                            <el-radio v-for="item in listState"
                                      :key="item.value" :value="item.value"
                                      :label="item.value">{{item.text}}</el-radio>
                        </el-radio-group>
                    </template>
                </el-form-item>

                <el-form-item label='备注' prop='TD_Remark'>
                    <el-input v-model='addForm.TD_Remark' auto-complete='off'
                              type="textarea" :rows="3"></el-input>
                </el-form-item>

            </el-form>
            <div slot='footer' class='dialog-footer'>
                <el-button @click.native='addFormVisible = false'>取消</el-button>
                <el-button type='primary' @click.native='addSubmit' :loading='addLoading'>提交</el-button>
            </div>
        </el-dialog>




        <!--更新物料类型-->
        <el-dialog title='更新物料' :visible.sync='editFormWLVisible' v-model='editFormWLVisible' :close-on-click-modal='false'>
            <el-form :model='editFormWL' label-width='80px' :rules='editFormWLRules' ref='editFormWL'>

                <el-form-item label='通道名称' prop='TD_Name'>
                    <el-input v-model='editFormWL.TD_Name' auto-complete='off' placeholder="请填写通道名称"
                              readonly disabled  ></el-input>
                </el-form-item>

                <!--============== multiple =================================-->


                <el-form-item label='物料名称' prop='TD_WuLiao'>
                    <el-select style="width: 100%;" v-model="editFormWL.TD_WuLiao_List"
                               placeholder="请选择物料" multiple 
                               @change="SelectChange_WuLiaoType">
                        <el-option v-for="item in list_WuLiaoList"
                                   :key="item.WT_Code" :value="item.WT_Code" :label="item.WT_FullName">
                            <span style="float: left">{{ item.WT_FullName }}</span>
                        </el-option>
                    </el-select>
                </el-form-item>



                <el-form-item label='物料代码' prop='TD_WuLiaoCode'>
                    <el-input v-model='editFormWL.TD_WuLiaoCode' auto-complete='off'
                              readonly disabled></el-input>
                </el-form-item>

            </el-form>
            <div slot='footer' class='dialog-footer'>
                <el-button @click.native='editFormWLVisible = false'>取消</el-button>
                <el-button type='primary' @click.native='editFormWLSubmit' :loading='editFormWLLoading'>提交</el-button>
            </div>
        </el-dialog>

    </section>
</template>

<script>

    import util from '../../../util/date'
    import { testapi, getShangWeijiList, Update_DTSN_TongDaoWLCode, GetList_DTSN_WuLiaoType, getPage_DTSN_TongDao, getByID_DTSN_TongDao, edit_DTSN_TongDao, add_DTSN_TongDao, batchRemove_DTSN_TongDao, Remove_DTSN_TongDao } from '../../api/api';

    export default {
        data() {   // 全局变量
            return {
                filters: { name: '' },
                users: [],
                typeList: [{ text: '熟料', value: 1 }, { text: '散料', value: 2 }],
                listState: [{ text: '正常', value: 0 }, { text: '禁用', value: 1 }],
                list_ShangWeiji: [],
                total: 0,

                pageIndex: 1,
                pageSize: 20,

                sidx: null,   //  排序字段
                order: null,  //  排序方式， 正序\倒序

                listLoading: false,
                sels: [],//列表选中列
                addDialogFormVisible: false,
                editFormVisible: false,//编辑界面是否显示
                editLoading: false,
                editFormRules: {
                    TD_ID: [{ required: true, message: '请输入通道', trigger: 'blur' }],
                    TD_Name: [{ required: true, message: '请输入通道名称', trigger: 'blur' }],
                    TD_Code: [{ required: true, message: '请输入通道代码', trigger: 'blur' }],
                    TD_Remark: [{ required: true, message: '请输入备注', trigger: 'blur' }],
                    TD_CreateTime: [{ required: true, message: '请输入创建时间', trigger: 'blur' }],
                    TD_Type: [{ required: true, message: '请输入配型', trigger: 'blur' }],
                    TD_State: [{ required: true, message: '请输入状态', trigger: 'blur' }],
                    //TD_WuLiao: [{ required: true, message: '请输入物料名称', trigger: 'blur' }],
                    //TD_WuLiaoCode: [{ required: true, message: '请输入物料代码', trigger: 'blur' }],
                    //TD_Weight: [{ required: true, message: '请输入重量', trigger: 'blur' }],
                    //TD_WeightA: [{ required: true, message: '请输入重量', trigger: 'blur' }],
                }
                ,
                //编辑界面数据
                editForm: {
                    TD_ID: 0,
                    TD_Name: '',
                    TD_Code: '',
                    TD_Remark: '',
                    TD_CreateTime: '1900-01-01',
                    TD_Type: 1,
                    TD_State: 0,
                    TD_WuLiao: '',
                    TD_WuLiaoCode: '',
                    TD_Weight: 0,
                    TD_WeightA: 0,
                    TD_ShangWeiji: 0
                },
                addFormVisible: false,//新增界面是否显示
                addLoading: false,
                addFormRules: {
                    TD_ID: [{ required: true, message: '请输入通道', trigger: 'blur' }],
                    TD_Name: [{ required: true, message: '请输入通道名称', trigger: 'blur' }],
                    TD_Code: [{ required: true, message: '请输入通道代码', trigger: 'blur' }],
                    TD_Remark: [{ required: true, message: '请输入备注', trigger: 'blur' }],
                    TD_CreateTime: [{ required: true, message: '请输入创建时间', trigger: 'blur' }],
                    //TD_Type: [{ required: true, message: '请输入配型', trigger: 'blur' }],
                    TD_State: [{ required: true, message: '请输入状态', trigger: 'blur' }],
                    //TD_WuLiao: [{ required: true, message: '请输入物料名称', trigger: 'blur' }],
                    //TD_WuLiaoCode: [{ required: true, message: '请输入物料代码', trigger: 'blur' }],
                    //TD_Weight: [{ required: true, message: '请输入重量', trigger: 'blur' }],
                    //TD_WeightA: [{ required: true, message: '请输入重量', trigger: 'blur' }],
                }
                ,
                //新增界面数据
                addForm: {
                    TD_Name: '',
                    TD_Code: '',
                    TD_Remark: '',
                    TD_CreateTime: '1900-01-01',
                    TD_Type: 2,
                    TD_State: 0,
                    TD_WuLiao: '',
                    TD_WuLiaoCode: '',
                    TD_Weight: 0,
                    TD_WeightA: 0,
                    TD_ShangWeiji: 0
                },


                list_WuLiaoList: [],
                editFormWLVisible: false,//编辑界面是否显示
                editFormWLLoading: false,
                editFormWL: {
                    TD_ID: 0,
                    TD_WuLiao: '',
                    TD_WuLiaoCode: '',
                    TD_WuLiao_List: []
                },
                editFormWLRules: {
                    TD_ID: [{ required: true, message: '请输入通道', trigger: 'blur' }],
                    TD_Name: [{ required: true, message: '请输入通道名称', trigger: 'blur' }],
                    TD_WuLiao: [{ required: true, message: '请输入物料名称', trigger: 'blur' }],
                    TD_WuLiaoCode: [{ required: true, message: '请输入物料代码', trigger: 'blur' }],

                }
            }
        },
        methods: {




            //   全局方法
            // 性别显示转换
            //formatSex: function (row, column) {
            //    return row.C_Value == 2 ? '男' : row.C_Value;
            //},
            //formatterCreateTime: function (row, column) {
            //    return (!row.C_CreateTime || row.C_CreateTime == '') ? '' : util.formatDate.format(new Date(row.C_CreateTime), 'yyyy-MM-dd');
            //},
            //  // 当前页
            handleCurrentChange(val) {
                this.pageIndex = val;
                this.getDtoPage();
            },
            // 每页数
            handleSizeChange(val) {
                this.pageSize = val;
                this.pageIndex = 1;
                this.getDtoPage();
            },
            // 测试
            sortKey(val) {
                console.log(val)
            },
            sortChange(column) {
                console.log(column.prop + "--" + column.order)
                this.sidx = column.prop
                this.order = column.order
                this.getDtoPage();
            },

            //获取用户列表
            getDtoPage() {
                let para = {
                    page: this.pageIndex,
                    pageSize: this.pageSize,
                    key: this.filters.name,
                    sidx: this.sidx,
                    order: this.order
                };
                this.listLoading = true;

                testapi();

                getPage_DTSN_TongDao(para).then((res) => {

                    this.total = res.data.response.dataCount;
                    this.users = res.data.response.data;
                    this.listLoading = false;

                });
            },
            //删除
            handleDel: function (index, row) {
                this.$confirm('确认删除该记录吗?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.listLoading = true;
                    let para = { id: row.TD_ID };
                    Remove_DTSN_TongDao(para).then((res) => {
                        if (util.isEmt.format(res)) {
                            this.listLoading = false;
                            return;
                        }
                        this.listLoading = false;
                        if (res.data.success) {
                            this.$message({
                                message: '删除成功',
                                type: 'success'
                            });
                        } else {
                            this.$message({
                                message: res.data.msg,
                                type: 'error'
                            });
                        }
                        this.getDtoPage();
                    });
                }).catch((c) => {
                    console.log(c);
                });
            },

            //显示编辑界面
            WlTypeEdit: function (index, row) {
                this.editFormWLVisible = true;

                let para_getGetByID = { id: row.TD_ID };

                getByID_DTSN_TongDao(para_getGetByID).then((getDto) => {

                    console.log(getDto.data.response.TD_WuLiaoCode);
                    let listWL = getDto.data.response.TD_WuLiaoCode.split(';');
                    console.log(listWL);
                    getDto.data.response.TD_WuLiao_List = listWL;
                    this.editFormWL = Object.assign({}, getDto.data.response);
                });


            },

            //显示编辑界面
            handleEdit: function (index, row) {
                this.editFormVisible = true;

                let para_getGetByID = { id: row.TD_ID };

                getByID_DTSN_TongDao(para_getGetByID).then((getDto) => {
                    this.editForm = Object.assign({}, getDto.data.response);
                });

            },
            //显示新增界面
            handleAdd() {
                this.addFormVisible = true;
                this.addForm = {
                    TD_Name: '',
                    TD_Code: '',
                    TD_Remark: '',
                    TD_CreateTime: '1900-01-01',
                    TD_Type: 1,
                    TD_State: 0,
                    TD_WuLiao: '',
                    TD_WuLiaoCode: '',
                    TD_Weight: 0,
                    TD_WeightA: 0,
                }
                    ;
            },
            //编辑
            editSubmit: function () {
                this.$refs.editForm.validate((valid) => {
                    if (valid) {
                        this.$confirm('确认提交吗？', '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                        }).then(() => {
                            this.editLoading = true;
                            //NProgress.start();
                            let para = Object.assign({}, this.editForm);

                            edit_DTSN_TongDao(para).then((res) => {

                                if (util.isEmt.format(res)) {
                                    this.editLoading = false;
                                    return;
                                }
                                if (res.data.success) {
                                    this.editLoading = false;

                                    this.$message({
                                        message: res.data.msg,
                                        type: 'success'
                                    });
                                    this.$refs['editForm'].resetFields();
                                    this.editFormVisible = false;
                                    this.getDtoPage();
                                } else {
                                    this.$message({
                                        message: res.data.msg,
                                        type: 'error'
                                    });
                                    this.editLoading = false;
                                    return;
                                }
                            });
                        });
                    }
                });
            },
            //新增
            addSubmit: function () {
                this.$refs.addForm.validate((valid) => {
                    if (valid) {
                        this.$confirm('确认提交吗？', '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                        }).then(() => {
                            this.addLoading = true;
                            let para = Object.assign({}, this.addForm);

                            add_DTSN_TongDao(para).then((res) => {

                                if (util.isEmt.format(res)) {
                                    this.addLoading = false;
                                    return;
                                }

                                if (res.data.success) {
                                    this.addLoading = false;
                                    this.$message({
                                        message: res.data.msg,
                                        type: 'success'
                                    });
                                    this.$refs['addForm'].resetFields();
                                    this.addFormVisible = false;
                                    this.getDtoPage();
                                }
                                else {
                                    this.$message({
                                        message: res.data.msg,
                                        type: 'error'
                                    });
                                }
                            });
                        });
                    }
                });
            },
            selsChange: function (sels) {
                this.sels = sels;
            },
            //批量删除
            batchRemove: function () {

                var ids = this.sels.map(item => item.TD_ID).toString();
                this.$confirm('确认删除选中记录吗？', '提示', {
                    type: 'warning',
                    confirmButtonText: '确定',
                    cancelButtonText: '取消'
                }).then(() => {
                    this.listLoading = true;
                    let para = { ids: ids };

                    batchRemove_DTSN_TongDao(para).then((res) => {
                        this.listLoading = false;

                        if (res.data.success) {
                            this.$message({
                                message: '删除成功',
                                type: 'success'
                            });
                        } else {
                            this.$message({
                                message: res.data.msg,
                                type: 'error'
                            });
                        }
                        this.getDtoPage();
                    });
                }).catch(() => {

                });
            }
            ,
            SelectChange_WuLiaoType: function (sels) {
                //console.log('sels.split', sels.join(';')  );//以分号拆分字符串
                this.editFormWL.TD_WuLiaoCode = sels.join(';');
            },
            // 更新物料代码
            editFormWLSubmit: function () {
                this.$refs.editFormWL.validate((valid) => {
                    if (valid) {
                        this.$confirm('确认提交吗？', '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                        }).then(() => {
                            this.editFormWLLoading = true;
                            let para = Object.assign({}, this.editFormWL);

                            console.log('para', para);

                            Update_DTSN_TongDaoWLCode(para).then((res) => {

                                if (util.isEmt.format(res)) {
                                    this.editFormWLLoading = false;
                                    return;
                                }

                                if (res.data.success) {
                                    this.editFormWLLoading = false;
                                    this.$message({
                                        message: res.data.msg,
                                        type: 'success'
                                    });
                                    this.$refs['editFormWL'].resetFields();
                                    this.editFormWLVisible = false;
                                    this.getDtoPage();
                                }
                                else {
                                    this.$message({
                                        message: res.data.msg,
                                        type: 'error'
                                    });
                                }
                            });
                        });
                    }
                });
            }



        },
        mounted() {

            this.getDtoPage();

            const matched = this.$route.matched;
            let routers = JSON.parse(localStorage.getItem('router'));
            let arrObj = [];
            for (let i = 0; i < matched.length; i++) {
                routers = routers.filter((v) => {
                    return v.name == matched[i].name;
                })
                if (routers[0].children) routers = routers[0].children;
            }

            GetList_DTSN_WuLiaoType().then((getDto) => {
                // console.log((getDto.data.response));
                this.list_WuLiaoList = (getDto.data.response);
            });

            getShangWeijiList().then((getDto) => {
                // console.log((getDto.data.response));
                this.list_ShangWeiji = (getDto.data.response);
            });

        },
        filters: {
            //tag类型
            getBindStatus(bindStatus) {
                const bindColor = {
                    1: 'danger',
                    0: 'success',
                };
                return bindColor[bindStatus]
            },
            //颜色名称
            getBindText(bindStatus) {
                const bindColor = {
                    1: '禁用',
                    0: '启用',
                };
                return bindColor[bindStatus]
            }
        }
    }

</script>

<style scoped>
</style>
